/*
 * @Description: 
 * @Autor: lizhengkun
 * @Date: 2021-08-10 11:01:24
 */
import { setBrowsedLog, setRecmID, setGpslog } from '@/services/MpbankBase';
import { GetParam } from '@/utils';

// 记录浏览日志
export function setBrowLog(toPath, fromPath) {
  const usrret = '{mpbank=1}';
  const syscod = 'mpbank';
  const sysret = '1';
  const pagenm = window.location.host + toPath;
  const referer = window.location.host + fromPath;
  const useragent = navigator.userAgent;
  const trackstamp = GetParam(window.location.href).trackstamp;
  const eventid = GetParam(window.location.href).eventid;
  setBrowsedLog(usrret, syscod, sysret, pagenm, referer, useragent, trackstamp, eventid);
}

// 记录推荐信息
export function setRecm(toPath, fromPath) {
  const referer = window.location.host + fromPath;
  const requri = window.location.host + toPath;
  const useragent = navigator.userAgent;
  const dptidt = GetParam(window.location.href).dptidt;
  const usernbr = GetParam(window.location.href).usernbr;
  setRecmID(referer, requri, useragent, dptidt, usernbr);
}

/**
 * 获取GPS地理位置信息，并记录后台GPS日志
 * 调用方式：
 *    getGPSInfo((gpsInfo) => {
 *    })
 * gpsInfo.latitude  坐标纬度
 * gpsInfo.longitude  坐标精度
 * gpsInfo.locationState  状态码（定位状态描述，如“正常”、“定位超时”等）
 * gpsInfo.locationTime  定位时间
 * gpsInfo.mapType  定位类型（dg高德 / bd百度）
 * gpsInfo.addressInfo.name  地名
 * gpsInfo.addressInfo.province  省份
 * gpsInfo.addressInfo.subCity  区/县
 * gpsInfo.addressInfo.street  街道
 * gpsInfo.errCode  错误码
 * gpsInfo.errMsg  错误信息
 */
export function getGPSInfo(callbackfn) {

}
